package com.jstyle.jclifexd.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.jstyle.jclifexd.utils.Utils;

import uk.co.chrisjenx.calligraphy.CalligraphyConfig;

public class LocaleChangeReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals(Intent.ACTION_LOCALE_CHANGED)) {
            CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
                    .setDefaultFontPath(Utils.IsRussian(context)?"SourceHanSansCN-Regular.ttf":"ROBOTO-REGULAR_2.TTF")
                    .build()
            );
        }
    }
}

